package com.keba.lamp.complaint.enumeration;


import com.keba.basic.interfaces.BaseEnum;
import com.keba.lamp.model.enumeration.base.ActiveStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "账户类型-枚举")
public enum AccountTypeEnum {

    /**
     * 余额账户
     */
    BALANCE("预付款账户",1),
    /**
     * 其他
     */
    OTHER("其他",9),
    ;



    @Schema(description = "描述")
    private String desc;
    @Schema(description = "状态")
    private Integer code;


    public static AccountTypeEnum getByCode(Integer code) {

        return Stream.of(AccountTypeEnum.values())
                .filter(p -> p.getCode().equals(code))
                .findAny()
                .orElse(null);
    }

}
